﻿using System;
using System.Collections.Generic;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

namespace TinyLib.Audio
{
    public class AudioManager : GameComponent
    {

        //holds a musicManager and soundManager
        //loads all sounds in its init-function (through smaller divided functions in the 'Load Sound Functions' - region)

        #region Fields

        private SoundManager soundManager = null;
        private MusicManager musicManager = null;

        #endregion

        #region Properties

        public SoundManager Soundmanager
        {
            get { return soundManager; }
        }

        public MusicManager Musicmanager
        {
            get { return musicManager; }
        }

        #endregion

        #region Inits

        public AudioManager(Game game)
            : base(game)
        {
            soundManager = new SoundManager(game);
            musicManager = new MusicManager(game);
            LoadTest();
        }

        public void Update(GameTime gameTime)
        {
            musicManager.Update(gameTime);
            soundManager.Update(gameTime);
        }

        #endregion

        #region Load Sound functions

        private void LoadTest()
        {
            soundManager.LoadSound("button");
            soundManager.LoadSound("fart8");
            soundManager.LoadSound("fart-wav-3");
            soundManager.LoadSound("fart-wav4");
        }

        private void LoadGameMusic()
        {
        }

        private void LoadMiscMusic()
        {
        }


        private void LoadFeedbackSounds()
        {
        }

        #endregion

    }
}
